package com.luo.chengrui.module.sa.dal.mysql.matrix;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import com.luo.chengrui.module.sa.dal.dataobject.matrix.OporgManagerMatrixDO;
import org.apache.ibatis.annotations.Mapper;
import com.luo.chengrui.module.sa.controller.admin.matrix.vo.*;

/**
 * 组织管理矩阵 Mapper
 *
 * @author luodz
 */
@Mapper
public interface OporgManagerMatrixMapper extends BaseMapperX<OporgManagerMatrixDO> {

    default PageResult<OporgManagerMatrixDO> selectPage(OporgManagerMatrixPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OporgManagerMatrixDO>()
                .likeIfPresent(OporgManagerMatrixDO::getName, reqVO.getName())
                .eqIfPresent(OporgManagerMatrixDO::getManagerDefineIds, reqVO.getManagerDefineIds())
                .eqIfPresent(OporgManagerMatrixDO::getRunning, reqVO.getRunning())
                .betweenIfPresent(OporgManagerMatrixDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(OporgManagerMatrixDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(OporgManagerMatrixDO::getRemark, reqVO.getRemark())
                .eqIfPresent(OporgManagerMatrixDO::getStatus, reqVO.getStatus())
                .orderByDesc(OporgManagerMatrixDO::getId));
    }

    default List<OporgManagerMatrixDO> selectList(OporgManagerMatrixExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<OporgManagerMatrixDO>()
                .likeIfPresent(OporgManagerMatrixDO::getName, reqVO.getName())
                .eqIfPresent(OporgManagerMatrixDO::getManagerDefineIds, reqVO.getManagerDefineIds())
                .eqIfPresent(OporgManagerMatrixDO::getRunning, reqVO.getRunning())
                .betweenIfPresent(OporgManagerMatrixDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(OporgManagerMatrixDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(OporgManagerMatrixDO::getRemark, reqVO.getRemark())
                .eqIfPresent(OporgManagerMatrixDO::getStatus, reqVO.getStatus())
                .orderByDesc(OporgManagerMatrixDO::getId));
    }

}
